package servlet;

/**
 * @Author Echo
 * @Date 2022-03-12 8:12
 */
import hbase.Student;

import hbase.HbaseUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

/*@WebServlet("")
public class StudentAdd extends HttpServlet{




  @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
   /*   String id = req.getParameter("studentId");
      String name = req.getParameter("name");
      String date =  req.getParameter("date");
      String contact = req.getParameter("cn");
      String semester=req.getParameter("semester");
      String status = req.getParameter("studentStatus");

      ArrayList<Student> studentArrayList = new ArrayList<>();
      Student student = new Student();
      student.setStudentId(id);
      student.setName(name);
      student.setDate(date);
      student.setCn(contact);
      student.setSemester(semester);
      student.setStudentStatus(status);
      studentArrayList.add(student);


      HbaseUtil hbaseAddUtil = new HbaseUtil();
      String obj_value = "";
      try{

          obj_value = hbaseAddUtil.insertinfo("niit01","2181","Student",studentArrayList);
      }catch (Exception e){
          e.printStackTrace();
      }

      resp.setContentType("text/html;charset=utf-8");
      PrintWriter pw = resp.getWriter();
      pw.write("<h1>"+ obj_value);



  }
 protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      super.doPost(req, resp);
    }
}
*/
